<title>工单系统</title>

<div class="layui-card layadmin-header">
    <div class="layui-breadcrumb" lay-filter="breadcrumb">
        <a lay-href="">主页</a>
        <a><cite>应用</cite></a>
        <a><cite>工单系统</cite></a>
    </div>
</div>

<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="app-content-workorder">
            <div class="layui-form-item">
                <div class="layui-inline">
                    <label class="layui-form-label">工单号</label>
                    <div class="layui-input-block">
                        <input autocomplete="off" class="layui-input" name="orderid" placeholder="请输入" type="text">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">工单标题</label>
                    <div class="layui-input-block">
                        <input autocomplete="off" class="layui-input" name="title" placeholder="请输入" type="text">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">业务性质</label>
                    <div class="layui-input-block">
                        <input autocomplete="off" class="layui-input" name="attr" placeholder="请输入" type="text">
                    </div>
                </div>
                <div class="layui-inline">
                    <label class="layui-form-label">受理人</label>
                    <div class="layui-input-block">
                        <input autocomplete="off" class="layui-input" name="accept" placeholder="请输入" type="text">
                    </div>
                </div>
                <div class="layui-inline">
                    <button class="layui-btn layuiadmin-btn-order" lay-filter="LAY-app-order-search" lay-submit>
                        <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
                    </button>
                </div>
            </div>
        </div>
        <div class="layui-card-body">
            <table id="LAY-app-workorder" lay-filter="LAY-app-workorder"></table>
            <script id="progressTpl" type="text/html">
                <div class="layui-progress layuiadmin-order-progress" lay-filter="progress-" + {{ d.orderid }} +"">
                <div class="layui-progress-bar layui-bg-blue" lay-percent={{ d.progress }}></div>
                </div>
            </script>
            <script id="buttonTpl" type="text/html">
                {{#  if(d.state == '已处理'){ }}
                <button class="layui-btn layui-btn-normal layui-btn-xs">已处理</button>
                {{#  } else if(d.state == '未分配'){ }}
                <button class="layui-btn layui-btn-primary layui-btn-xs">未分配</button>
                {{#  } else{ }}
                <button class="layui-btn layui-btn-warm layui-btn-xs">处理中</button>
                {{#  } }}
            </script>
            <script id="table-system-order" type="text/html">
                <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i
                        class="layui-icon layui-icon-edit"></i>编辑</a>
            </script>
        </div>
    </div>
</div>

<script>
    layui.use('workorder', layui.factory('workorder')).use(['admin', 'workorder', 'table'], function () {
        var $ = layui.$
            , form = layui.form
            , table = layui.table;

        form.render(null, 'app-content-workorder');

        //监听搜索
        form.on('submit(LAY-app-order-search)', function (data) {
            var field = data.field;

            //执行重载
            table.reload('LAY-app-workorder', {
                where: field
            });
        });
    });
</script>